2006-05-24 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkfontbutton.c (gtk_font_button_clicked):
+ * gtk/gtkcolorbutton.c (gtk_color_button_clicked):
+ Fix the handling of modality by copying what
+ GtkFileChooserButton does. (#342754, Yevgen Muntyan)
+
* gtk/gtkprintunixdialog.c (create_main_page): Make
the range entry insensitive if another range option
is selected. (#342783, Caolan McNamara)
2006-05-24 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkfontbutton.c (gtk_font_button_clicked):
+ * gtk/gtkcolorbutton.c (gtk_color_button_clicked):
+ Fix the handling of modality by copying what
+ GtkFileChooserButton does. (#342754, Yevgen Muntyan)
+
* gtk/gtkprintunixdialog.c (create_main_page): Make
the range entry insensitive if another range option
is selected. (#342783, Caolan McNamara)
color_dialog = GTK_COLOR_SELECTION_DIALOG (color_button->priv->cs_dialog);
- if (parent)
- gtk_window_set_transient_for (GTK_WINDOW (color_dialog),
- GTK_WINDOW (parent));
+ if (GTK_WIDGET_TOPLEVEL (parent) && GTK_IS_WINDOW (parent))
+ {
+ if (GTK_WINDOW (parent) != gtk_window_get_transient_for (GTK_WINDOW (color_dialog)))
+ gtk_window_set_transient_for (GTK_WINDOW (color_dialog), GTK_WINDOW (parent));
+
+ gtk_window_set_modal (GTK_WINDOW (color_dialog),
+ gtk_window_get_modal (GTK_WINDOW (parent)));
+ }
g_signal_connect (color_dialog->ok_button, "clicked",
G_CALLBACK (dialog_ok_clicked), color_button);
G_CALLBACK (dialog_cancel_clicked), color_button);
g_signal_connect (color_dialog, "destroy",
G_CALLBACK (dialog_destroy), color_button);
-
- /* If there is a grabbed window, set new dialog as modal */
- if (gtk_grab_get_current ())
- gtk_window_set_modal (GTK_WINDOW (color_button->priv->cs_dialog),TRUE);
}
color_dialog = GTK_COLOR_SELECTION_DIALOG (color_button->priv->cs_dialog);
font_dialog = GTK_FONT_SELECTION_DIALOG (font_button->priv->font_dialog);
- if (parent)
- gtk_window_set_transient_for (GTK_WINDOW (font_dialog), GTK_WINDOW (parent));
-
- /* If there is a grabbed window, set new dialog as modal */
- if (gtk_grab_get_current ())
- gtk_window_set_modal (GTK_WINDOW (font_dialog), TRUE);
+ if (GTK_WIDGET_TOPLEVEL (parent) && GTK_IS_WINDOW (parent))
+ {
+ if (GTK_WINDOW (parent) != gtk_window_get_transient_for (GTK_WINDOW (font_dialog)))
+ gtk_window_set_transient_for (GTK_WINDOW (font_dialog), GTK_WINDOW (parent));
+
+ gtk_window_set_modal (GTK_WINDOW (font_dialog),
+ gtk_window_get_modal (GTK_WINDOW (parent)));
+ }
g_signal_connect (font_dialog->ok_button, "clicked",
G_CALLBACK (dialog_ok_clicked), font_button);